﻿@model SlamDunk.CMS.Model.ViewModel.UserViewForManage

@{
    ViewBag.Title = "Add";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section header{
    <script type="text/javascript">
        $(function () {

        });
        //提交表单完成后执行方法
        function addFinished(jsonData) {
            if (jsonData.Status == '1') {
                window.top.window.$.messager.alert('OK', jsonData.Message);        //主窗口弹出消息提示
                $.globalParas.updateDataGridInTab();                                              //清除选中，刷新表格
                $.globalParas.closeComWindow();                                                    //关闭弹出窗口
            } else {
                window.top.window.$.messager.alert('Error', jsonData.Message);      //主窗口弹出消息提示
            }
        }
    </script>
    <style type="text/css">
        #dvIframe {
            margin-top: 15px;
            width: 318px;
            float: left;
        }

        #dvDep {
            margin-top: 18px;
            float: left;
        }

        #tblAdd {
            width: 300px;
            margin: 5px auto 0;
            text-align: right;
        }

            #tblAdd td input, textarea {
                width: 210px;
            }

        .tdValidate {
            text-align: right;
            color: #ff0000;
        }

        .tdContent {
            text-align: left;
        }
    </style>
}

@using (Ajax.BeginForm("AddConfirm", "User", new AjaxOptions { OnSuccess = "addFinished" }, new { id = "frmAdd" }))
{
    <div id="dvIframe">
        <table id="tblAdd">
            <tr>
                <td class="tdTitle">用户名：</td>
                <td class="tdContent">@Html.TextBoxFor(x => x.UserName, new { id = "txtUserName" })</td>
            </tr>
            <tr>
                <td class="tdValidate" colspan="2">@Html.ValidationMessageFor(x => x.UserName)</td>
            </tr>
            <tr>
                <td class="tdTitle">密码：</td>
                <td class="tdContent">@Html.PasswordFor(x => x.Password, new { id = "txtPassword" })</td>
            </tr>
            <tr>
                <td class="tdValidate" colspan="2">@Html.ValidationMessageFor(x => x.Password)</td>
            </tr>
            <tr>
                <td class="tdTitle">真实姓名：</td>
                <td class="tdContent">@Html.TextBoxFor(x => x.RealName, new { id = "txtRealName" })</td>
            </tr>
            <tr>
                <td class="tdValidate" colspan="2">@Html.ValidationMessageFor(x => x.RealName)</td>
            </tr>
            <tr>
                <td class="tdTitle">联系电话：</td>
                <td class="tdContent">@Html.TextBoxFor(x => x.PhoneNumber, new { id = "txtPhoneNumber" })</td>
            </tr>
            <tr>
                <td class="tdValidate" colspan="2">@Html.ValidationMessageFor(x => x.PhoneNumber)</td>
            </tr>
            <tr>
                <td class="tdTitle">电子邮箱：</td>
                <td class="tdContent">@Html.TextBoxFor(x => x.Email, new { id = "txtEmail" })</td>
            </tr>
            <tr>
                <td class="tdValidate" colspan="2">@Html.ValidationMessageFor(x => x.Email)</td>
            </tr>
            <tr>
                <td></td>
                <td class="tdContent">
                    <a href="#" onclick="javascript: $('#frmAdd').submit();" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">确定</a>
                    <a href="#" onclick="javascript: $.globalParas.closeComWindow();" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">取消</a>
                </td>
            </tr>
        </table>
    </div>
}
